import request from '@/router/axios';
import { getSession } from '@/util/auth'
let url = '/http/admin/center'
// let url = '/http/test'  //test
export const loginByUsername = params => request({
    url,
    method: 'post',
    meta: {
        isToken: false
    },
    data: {
        action: 'login',
        params: params
    }
})
export const getUserInfo = () => request({
    url,
    method: 'get',
    params: {
        action: 'checkToken'
    }
});

export const refeshToken = () => request({
    url,
    method: 'post',
    meta: {
        isToken: false
    },
    data: {
        action: 'login',
        params: JSON.parse(atob(getSession('user')))
    }
})
export const logout = () => request({
    url,
    method: 'post',
    data: {
        action: 'logout'
    }
});